load("@prelude//toolchains/android/tools:build_rules.bzl", "buck_kotlin_library")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

buck_kotlin_library(
    name = "language-version",
    srcs = ["LanguageVersion.kt"],
    labels = ["codegen_rule"],
    visibility = ["PUBLIC"],
)

buck_kotlin_library(
    name = "support",
    srcs = [
        "AnnotationProcessingTool.kt",
        "KotlinExtraParams.kt",
    ],
    labels = ["codegen_rule"],
    visibility = ["PUBLIC"],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/core/filesystems:filesystems",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:support",
        "prelude//toolchains/android/third-party:guava",
        ":language-version",
    ],
)

buck_kotlin_library(
    name = "command",
    srcs = ["BuildKotlinCommand.kt"],
    tests = [
        "prelude//toolchains/android/test/com/facebook/buck/jvm/kotlin:kotlin",
    ],
    visibility = ["PUBLIC"],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/cd/resources/proto:javacd-model",
        "prelude//toolchains/android/src/com/facebook/buck/cd/resources/proto:kotlincd-model",
        "prelude//toolchains/android/src/com/facebook/buck/core/filesystems:filesystems",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/cd/serialization:serialization",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/cd/serialization/java:java",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/cd/serialization/kotlin:kotlin",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/core:core",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:support",
        "prelude//toolchains/android/third-party:guava",
        ":support",
    ],
    exported_deps = [
        "prelude//toolchains/android/src/com/facebook/buck/jvm/cd/command:command",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/cd/command/kotlin:support",
    ],
)
